<% if @name.present? %>
  <turbo-frame id="<%= @name %>">
    <% if helpers.turbo_frame_request? %>
      <%= helpers.turbo_stream_action_tag :append, target: "alerts", template: render(Avo::FlashAlertsComponent.new(flashes: helpers.flash)) %>
    <% end %>
    <%= content %>
  </turbo-frame>
<% else %>
  <% if helpers.turbo_frame_request? %>
    <%= helpers.turbo_stream_action_tag :append, target: "alerts", template: render(Avo::FlashAlertsComponent.new(flashes: helpers.flash)) %>
  <% end %>
  <%= content %>
<% end %>
